import java.util.PriorityQueue;

public class Solution2233 {
    public int maximumProduct(int[] nums, int k) {
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>();
        for (int num : nums) {
            priorityQueue.offer(num);
        }
        for (int i = 0; i < k; i++) {
            priorityQueue.offer(priorityQueue.poll()+1);
        }
        long ans=1;
        while (!priorityQueue.isEmpty()){
            ans=ans*priorityQueue.poll()%1000000007;
        }
        return (int)ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2233().maximumProduct(new int[]{0,4},5));
    }
}
